package com.ibuonline.b2b.entity;

import java.io.Serializable;

public class ProdCategoryHierarchy implements Serializable {

	private static final long serialVersionUID = 2375999280931514050L;

	//fields
	private java.lang.Integer catId;
	private java.lang.Integer parentId;
	private java.lang.Integer level;
	private java.lang.Boolean master;
	private java.lang.Integer displayOrder;

	//default constructor
	public ProdCategoryHierarchy() {
	}

	//constructor with arguments
	public ProdCategoryHierarchy(java.lang.Integer catId, java.lang.Integer parentId) {
		this.catId = catId;
		this.parentId = parentId;
	}

	//getter
	public java.lang.Integer getCatId() {
		return catId;
	}
	public java.lang.Integer getParentId() {
		return parentId;
	}
	public java.lang.Integer getLevel() {
		return level;
	}
	public java.lang.Boolean isMaster() {
		return master;
	}
	public java.lang.Integer getDisplayOrder() {
		return displayOrder;
	}

	//setter
	public void setCatId(java.lang.Integer catId) {
		this.catId = catId;
	}
	public void setParentId(java.lang.Integer parentId) {
		this.parentId = parentId;
	}
	public void setLevel(java.lang.Integer level) {
		this.level = level;
	}
	public void setMaster(java.lang.Boolean master) {
		this.master = master;
	}
	public void setDisplayOrder(java.lang.Integer displayOrder) {
		this.displayOrder = displayOrder;
	}

	//equals method
	public boolean equals(Object other) {
		if (this == other)
			return true;
		if (!(other instanceof ProdCategoryHierarchy))
			return false;

		final ProdCategoryHierarchy prodCategoryHierarchy = (ProdCategoryHierarchy)other;
		if (!this.catId.equals(prodCategoryHierarchy.getCatId()) || 
			!this.parentId.equals(prodCategoryHierarchy.getParentId()))
			return false;

		return true;
	}

	//hashCode method
	public int hashCode() {
		StringBuffer keys = new StringBuffer();
		keys.append(catId).append(",");
		keys.append(parentId).append(",");
		if (keys.length() > 0)
			keys.deleteCharAt(keys.length() - 1);
		return keys.toString().hashCode();
	}

	//toString method
	public String toString() {
		return new StringBuilder("ProdCategoryHierarchy[")
			.append("catId=").append(catId).append(", ")
			.append("parentId=").append(parentId).append(", ")
			.append("level=").append(level).append(", ")
			.append("master=").append(master).append(", ")
			.append("displayOrder=").append(displayOrder).append("]").toString();
	}
}